import { createApp } from "vue";
import * as SCComponent from "@sribd/sc-ui";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import "element-plus/theme-chalk/index.css";
import "virtual:svg-icons-register";
// tslint:disable-next-line no-import-side-effect
import "./style.scss";
import App from "./App.vue";
import router from "./router";
import "./premission"
import { createPinia } from "pinia";
import SvgIcon from "./components/SvgIcon.vue";
import trim from "./directives/trim";
import "virtual:svg-icons-register";

// tslint:disable-next-line no-unsafe-any
const app = createApp(App);
app.directive("trim", trim);
app.component("SvgIcon", SvgIcon);
app.use(createPinia());
app.use(router);

for (const [key, component] of Object.entries(SCComponent)) {
    // tslint:disable-next-line
    app.component(key, component);
}

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
app.directive("loading", SCComponent.vLoading);
app.mount("#app");
